package com.zwx.bingo.data.batis.abstraction.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zwx.bingo.abstraction.service.ConditionalService;
import com.zwx.bingo.data.batis.abstraction.AbstractMapper;
import com.zwx.bingo.data.body.AbstractQueryRequestBody;
import com.zwx.bingo.data.interfaces.IRawService;

import java.io.Serializable;

/**
 * @author zoo
 * @since 2.0.3
 */
public interface AbstractBatisService<ENTITY extends Serializable, ID extends Serializable, QUERY extends AbstractQueryRequestBody> extends
        //with find service support
        ConditionalService<ENTITY, QUERY>, IRawService<ENTITY, ID> {

    public AbstractMapper<ENTITY> getBatisDao();

    /**
     * 搜索条件应该由后台服务控制，所以都在实现类里面进行条件组装
     */
    public default QueryWrapper<ENTITY> getFindAllSpecification(QUERY queryRequestBody) {
        return null;
    }

    public default QueryWrapper<ENTITY> getExistsSpecification(
            QUERY queryRequestBody) {
        return null;
    }

    public default QueryWrapper<ENTITY> getCountSpecification(
            QUERY queryRequestBody) {
        return null;
    }

    public default QueryWrapper<ENTITY> getDeleteByConditionSpecification(
            QUERY queryRequestBody) {
        return null;
    }


}
